import Head from "next/head";
import FoodTruckList from "@/components/food-trucks/FoodTruckList";
// import Registration from "@/components/registration";
import { getCollectedFoodTrucks } from "@/services";

export default function Home(props) {
  const { foodTrucks } = props;
  return (
    <div>
      <Head>
        <title>Collected Food Trucks Page</title>
        <meta name="description" content="Find a lot of great foodTrucks" />
      </Head>
      {/* <Registration /> */}
      <FoodTruckList items={foodTrucks} />
    </div>
  );
}

export async function getStaticProps() {
  const foodTrucks = await getCollectedFoodTrucks();
  return {
    props: {
      foodTrucks,
    },
    revalidate: 2000,
  };
}
